<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<%@ page import="com.scalar.chiptrack.commons.Constants" %>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>

<chiptrack:checkLogon sourcePage="/inventorypsSearch.do"/>
<%
	String chipTracContext = "/" + ConfigManager.getChipTracContext();
    String userTypeChiptrac = Constants.USER_TYPE_CHIPTRAC + "";
%>

<HTML><HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type="text/css" rel="stylesheet">
<script src="<%=chipTracContext%>/jsp/includes/scripts/functions.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/validations.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/quickSearch.js"></script>
<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">

<script language="javascript">
var listSize = 0;
window.onload = init;
function init()
{
    if ( document.inventoryPackingSlipSearchForm.searchProcessStepId  != null)
    {
        qs_1 = new QuickSearch( document.inventoryPackingSlipSearchForm.searchProcessStepId, document.inventoryPackingSlipSearchForm.qs1, false);
    }
}

function reset()
{
    document.inventoryPackingSlipSearchForm.reset();
    qs_1.resetQuickSearchCntrl();
}

function searchPackingSlips()
{
    var form = document.inventoryPackingSlipSearchForm;

		document.inventoryPackingSlipSearchForm.action = '<%=chipTracContext%>/inventorypsSearch.do?action=search';
		document.inventoryPackingSlipSearchForm.submit();
}

function selectProcessType()
{
    var form = document.inventoryPackingSlipSearchForm;
	document.inventoryPackingSlipSearchForm.action = '<%=chipTracContext%>/inventorypsSearch.do?action=load';
    form.submit();
 }

var dateElement = "";
function openCalendar( dateValue )
{
    dateElement = dateValue;
    newWindow = window.open('<%=chipTracContext%>/jsp/includes/calendar.html','optionsPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=no,width=180,height=440,resizable=no');
    newWindow.focus();
}

function assignDate( passedValue )
{
    dateElement.value=passedValue;
    window.focus();
}
 
function createNewPackingSlip()
{
		document.inventoryPackingSlipSearchForm.action = '<%=chipTracContext%>/inventoryps.do';
		document.inventoryPackingSlipSearchForm.submit();
}

function issuedPackingSlip( packingSlipId )
{
    document.inventoryPackingSlipSearchForm.action = "<%=chipTracContext%>/inventoryps.do?action=modify&packingSlipId=" + packingSlipId ;
    document.inventoryPackingSlipSearchForm.submit();
}

function viewPackingSlip( packingSlipId )
{
    document.inventoryPackingSlipSearchForm.action = "<%=chipTracContext%>/inventoryps.do?action=view&packingSlipId=" + packingSlipId ;
    document.inventoryPackingSlipSearchForm.submit();
}
function generatePDF(packingSlipId)
{
    var generatePDFURL = '<%=chipTracContext%>/inventoryps.do?action=generatePDF&packingSlipId=' + packingSlipId;
    newWindow = window.open (generatePDFURL,'generatePDFPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=yes,resizable=yes');
    newWindow.focus();
}
</script>
<!-- Top Header Start-->
<logic:equal value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">
	<%@ include file="/jsp/includes/header.jsp" %>
</logic:equal>
<logic:notEqual value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">
	<%@ include file="/jsp/includes/extHeader.jsp" %>
</logic:notEqual>
<!-- Top Header End-->
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
	<TBODY>
	<TR>
		<td width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>
		<!-- Side Navigation start -->
	    <logic:equal value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">
		    <%@ include file="/jsp/operations/dataentryMenu.jsp" %>
		</logic:equal>
		<logic:notEqual value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">
			<%@ include file="/jsp/operations/ext_user_dataentryMenu.jsp" %>
		</logic:notEqual>
		<!-- end of the side navigations -->
		<TD bgcolor="#ffffff">
			<IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
		<TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
		<TD valign="top" width="100%">
		<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
		<BR>
		<html:form name="inventoryPackingSlipSearchForm" method = "POST"  type="com.scalar.chiptrack.operations.inventoryps.forms.InventoryPackingSlipSearchForm" action="/inventorypsSearch" >
		<TABLE border="0" width="100%" align=center>
			<TR><TD colspan=5 class="NArialW" align="center">Inventory Packing Slip Search</TD><TD width="25%" class="NArialL">&nbsp;</TD></TR>
			<TR><TD colspan=6>&nbsp;</TD></TR>
			<TR><TD colspan=6 class='NArialL'><strong><FONT id="message" styleClass="NArialL" color='FF0000'></FONT></strong></TD></TR>
			<TR><TD align="center" colspan=5>
			<chiptrack:info  styleClass="NArialL" />
			<chiptrack:errors styleClass="NArialL" />
			<chiptrack:messages type="info" styleClass="NArialL" />
			</TD><TD width="25%" class="NArialL">&nbsp;</TD>
			</TR>
			<logic:equal name="showMessage" value="TRUE">
					<tr><td colspan=6 align='left'><font class='NArialS'color='blue'><b><%=Constants.NO_MODIFY_RIGHTS %></b></font></TD></TR>
			</logic:equal>
            <TR><TD colspan="6"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></TD></TR>
			<TR>
				<TD>
					<TABLE  border="0" width="100%" cellpadding="1" cellspacing="1">
						<TR>
							<TD width="10%" class="NArialL">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
								<TD width="20%" nowrap class="NArialL">Process Type:<font color= "red">*</font></TD>
								<TD width="20%" class="NArialL">
									<html:select property="searchProcessType" name="inventoryPackingSlipSearchForm" styleClass="txfield" onchange="selectProcessType()" >
										<html:option value="0">Select Process Type</html:option>
										<html:options collection="processTypeList" property="value" labelProperty="label"/>
									</html:select>
								</TD>
						  <TD width="15%" class="NArialL">&nbsp;</TD>
						  <TD width="15%" class="NArialL">&nbsp;</TD>
						  <TD width="20%" class="NArialL">&nbsp;</TD>
					    </TR>
 						<TR>
							<TD colspan="6"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></TD>
					    </TR>
						    <TR>
								<TD width="10%" class="NArialL">&nbsp;</TD>
								<TD class="NArialL" width='20%'>Quick Search:</TD>
								<td class="NArialL" width='20%'>
							        <input type="text" name="qs1" class="txfield" size='23' onkeyup='quickSearch(qs_1)'/>
								</td>
						        <TD COLSPAN=3>&nbsp;</TD>
						    </TR>
						<TR>
								<TD width="10%" class="NArialL">&nbsp;</TD>
								<TD width="20%" class="NArialL">Product Name: </TD>
								<TD width="20%" class="NArialL">
								<html:select property="searchProcessStepId"  name="inventoryPackingSlipSearchForm" styleClass="txfield">
								<html:option value="0">Select Part Number</html:option>
								<html:options collection="partNumbersList" property="value" labelProperty="label"/>
								</html:select>
							</TD>
							<TD width="15%" class="NArialL">&nbsp;</TD>
							<TD width="15%" class="NArialL">&nbsp;</TD>
							<TD width="20%" class="NArialL">&nbsp;</TD>

					</TR>
					<TR>
						<TD colspan="6"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></TD>
					</TR> 
 					<TR>
							<TD width="10%" class="NArialL">&nbsp;</TD>
							<TD width="20%" nowrap class="NArialL">From Location:</TD>
							<TD width="20%" class="NArialL">
								<html:select property="searchLocationId" name="inventoryPackingSlipSearchForm" styleClass="txfield">
									<html:option value="0">Select To Location</html:option>
									<html:options collection="toLocationList" property="vendorId" labelProperty="vendorName"/>
								</html:select>
							</TD>
							<TD width="15%" nowrap class="NArialL">To Location:</TD>
							<TD width="15%" class="NArialL">
								<html:select property="searchToVendorId" name="inventoryPackingSlipSearchForm" styleClass="txfield">
									<html:option value="0">Select From Location</html:option>
									<html:options collection="locationList" property="vendorId" labelProperty="vendorName"/>
								</html:select>
							</TD>
							<TD width="20%" class="NArialL">&nbsp;</TD>
				   </TR> 
				   	<TR>
						<TD colspan="6"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></TD>
					</TR> 
				    <TR>
							<TD width="10%" class="NArialL">&nbsp;</TD>
							<TD width="20%" nowrap class="NArialL">From Date:</TD>
							<TD width="20%" class="NArialL">
								<html:text property="searchFromDate" name="inventoryPackingSlipSearchForm" styleClass="txfield" size="12" maxlength="10" />
																   <a href="javascript:openCalendar( document.inventoryPackingSlipSearchForm.fromDate )">
										<img onMouseOver="window.status='Click  to select date';return true" onMouseout="window.status='';return 	true" border="0" align='center' src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=20 width=20>
									</a>
							</TD>
							<TD width="15%" class="NArialL">To Date:</TD>
							<TD width="15%" class="NArialL"><html:text property="searchToDate" name="inventoryPackingSlipSearchForm" styleClass="txfield" size="12" maxlength="10" />
										<a href="javascript:openCalendar( document.inventoryPackingSlipSearchForm.toDate )">
										<img onMouseOver="window.status='Click  to select date';return true" onMouseout="window.status='';return 	true" border="0" align='center' src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=20 width=20>
									</a>
								</TD>
							<TD width="20%" class="NArialL">&nbsp;</TD>
				   </TR> 
				   <TR>
						<TD colspan="6"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></TD>
				   </TR>
					   <TR>
							<td colspan="6" align="center">
								<a href="javascript:searchPackingSlips()"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/search.gif" width="53" height="17" onmouseover="window.status='Click to Search for Inventory Packing Slip';return true" onmouseout="window.status='';return true"title="Click to Search for Inventory Packing Slip"/></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								<a href="javascript:reset();"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/reset.gif" width="53" height="17" onmouseover="window.status='Click to Reset';return true" onmouseout="window.status='';return true" title="Click here to Reset"></a>
							</td>
						</TR>
						<TR><TD colspan="6"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></TD></TR>
						<TR><TD colspan="1">&nbsp;</TD> 
                            <TD colspan="5" class='NArialL'><a href="javascript:createNewPackingSlip()" class="leftsection" onMouseOver="window.status='Click to generate new Inventory Packing Slip';return true" onMouseout="window.status='';return ">Click here</a> to generate new Inventory Packing Slip</TD></TR>
						<TR><TD colspan="6"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></TD></TR>
			    </TABLE>
			</TD>
		</TR>
	</TABLE>
 	<nested:present property="packingSlipList">
	<nested:size id="LotsSize" property="packingSlipList"/>
	<logic:greaterThan name="LotsSize" value="0">
	<table width="100%" align="center" cellpadding="2" cellspacing="2" border="0">
		<tr bgcolor="#993333" align = "center">
			<td class='NArialL'><font color="#FFFFFF">Packing Slip No </font></td>
			<td class='NArialL' nowrap><font color="#FFFFFF">From Location</font></td>
			<td class='NArialL' nowrap><font color="#FFFFFF">To Location</font></td>
			<td class='NArialL' nowrap><font color="#FFFFFF">Ship Date</font></td>
			<td class='NArialL'><font color="#FFFFFF">Status</font></td>
			<td class='NArialL'><font color="#FFFFFF">Action</font></td>
		</tr>
    <nested:iterate id="packingSlip" property="packingSlipList" indexId="iterateIdx" type = "com.scalar.chiptrack.operations.inventoryps.InventoryPackingSlip">

    <tr bgcolor='<%=iterateIdx.intValue() % 2 == 0 ? "#FFFFEE" : "#DEE1E2"%>'>
        <td class='NArialL'><nested:write name="packingSlip" property ="packingSlipNo"/></td>
        <td class='NArialL'><nested:write name="packingSlip" property ="fromVendor"/></td>
        <td class='NArialL'><nested:write name="packingSlip" property ="toVendor"/></td>
        <td class='NArialL'><nested:write name="packingSlip" property ="shipDate"/></td>
        <td class='NArialL'><nested:write name="packingSlip" property ="status"/></td>
        <td align="center" class='NArialL'>

			<A Href='javascript:viewPackingSlip(<bean:write name="packingSlip" property="packingSlipId"/>)'onmouseover="window.status='Click to View Packing Slip';return true" onmouseout="window.status='';return true">View</A>
		<nested:equal name="PackingSlip" property="status" value="ISSUED">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<A Href='javascript:issuedPackingSlip(<bean:write name="packingSlip" property="packingSlipId"/>)' onmouseover="window.status='Click to View/Modify Packing Slip';return true" onmouseout="window.status='';return true">Modify</A>
		</nested:equal>
		<nested:notEqual name="PackingSlip" property="status" value="ISSUED">
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Modify
		</nested:notEqual>
		</td>
        <nested:hidden property="packingSlipId"/>
    </tr>
    </nested:iterate>
     <TR>
        <TD COLSPAN="13"><IMG SRC="<%=chipTracContext%>/jsp/includes/images/spacer.gif" HEIGHT=20></TD>
    </TR>
	</table>
	</logic:greaterThan>
	<logic:equal name="LotsSize" value="0">
		<table width="100%" align="left" cellpadding="2" cellspacing="2" border="0">
		<tr align = "left"><td class='NArialL'>* No Packingslips available for the search creteria</td></tr></table>
	</logic:equal>
	</nested:present> 
</html:form>
<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</TABLE>
<!-- Footer starts here -->
<%@ include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->
</BODY>
</HTML>

